import request from '@/utils/request'

// 获取工单列表
export const taskSearch = (data) => {
  return request.get('/task-service/task/search', {
    params: data
  })
}

// 获取工单状态
export const allTaskStatus = () => {
  return request.get('/task-service/task/allTaskStatus')
}

//  获取工单类型
export const getTaskTypeList = (val) => {
  return request.get('/task-service/taskType/list', val)
}

//  获取工单详情
export const getTaskInfo = (id) => {
  return request.get(`/task-service/task/taskInfo/${id}`)
}

// 获取补货详情
export const getTaskDetails = (id) => {
  return request.get(`/task-service/taskDetails/${id}`)
}

// 取消工单 /task-service/task/cancel/
export const cancelTask = (id) => {
  return request.post(`/task-service/task/cancel/${id}`)
}

// 新建工单
export const createTask = (data) => {
  return request.post('/task-service/task/create', data)
}
